Conversation
The analyzeFirewallLogs() function was looking for directories named
exactly 'squid-logs' or 'firewall-logs', but workflow artifacts are
uploaded with workflow-specific suffixes like:
- squid-logs-smoke-copilot-firewall
- squid-logs-changeset-generator
- firewall-logs-{workflow-name}
This caused firewall logs to be uploaded but not parsed, resulting in
'firewall_analysis: null' in run_summary.json files.
Changes:
- Modified directory discovery to use prefix matching instead of exact match
- Added verbose logging when firewall log directory is found
- Added comprehensive test case TestAnalyzeFirewallLogsWithWorkflowSuffix()
- Added detailed comments explaining workflow-specific suffix pattern
Impact:
- Firewall logs will now be parsed correctly regardless of suffix
- gh aw logs command will show firewall statistics
- gh aw audit command will include firewall analysis
Fixes: Firewall logs uploaded but not analyzed
Related: FIREWALL_LOG_PARSER_IMPLEMENTATION.md
pelikhan
approved these changes
Oct 28, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Q Workflow Optimization Report
Investigation Summary
User Question: "/q investigate the issue with firewall logs. Are they uploaded or is it an issue in logs?"
Answer:
Issues Found (from live data)
Firewall Log Analysis
Analyzed Runs: 18874197110, 18874317908, 18874452198
Evidence:
squid-logs-smoke-copilot-firewall/,squid-logs-changeset-generator/run_summary.jsonfiles show"firewall_analysis": nullRoot Cause:
The
analyzeFirewallLogs()function inpkg/cli/firewall_log.go(lines 315-330) was looking for directories named exactly:squid-logsfirewall-logsBut actual artifact directories have workflow-specific suffixes:
squid-logs-{workflow-name}(e.g.,squid-logs-smoke-copilot-firewall)firewall-logs-{workflow-name}This directory name mismatch caused uploaded logs to be ignored during analysis.
Changes Made
pkg/cli/firewall_log.go
Lines modified: 316-343
Changes:
os.ReadDir()to scan all directoriesstrings.HasPrefix()Before:
After:
pkg/cli/firewall_log_test.go
Added:
TestAnalyzeFirewallLogsWithWorkflowSuffix()(60 lines)Purpose: Validates that firewall log parsing works with workflow-specific directory suffixes
Test coverage:
squid-logs-smoke-copilot-firewall/access.logwith 3 requests (2 allowed, 1 denied)analyzeFirewallLogs()finds and parses the logs correctlyExpected Improvements
After this fix:
run_summary.jsonwill include firewall analysis datagh aw logscommand will display firewall statistics in outputgh aw auditcommand will include firewall analysis in reportsValidation
Unit Test Added:
TestAnalyzeFirewallLogsWithWorkflowSuffix()- Tests realistic workflow artifact structureManual Validation:
squid-logs-{workflow-name}patternReferences
/tmp/gh-aw/cache-memory/q-firewall-investigation.md/tmp/gh-aw/aw-mcp/logs/run-18874197110/squid-logs-smoke-copilot-firewall/FIREWALL_LOG_PARSER_IMPLEMENTATION.md